package main

import (
	"fmt"
	"math/rand"
	"sync"
)

var num [100]int

func main() {
	var group sync.WaitGroup
	group.Add(2)
	go fill(num[0:50], &group)
	go fill(num[50:], &group)
	group.Wait()
	fmt.Print(num)
}

func fill(s []int, wg *sync.WaitGroup) {
	defer wg.Done()
	for i := range s {
		s[i] = rand.Intn(101)
	}
}
